<?php
/**
 * Created by PhpStorm.
 * Author: ls
 * Time: 2023/9/19 13:39
 * Desc: 积分商城
 */
class Request_Api_V2_Integral_Mall extends Request_Api_V2_Base
{

    public function __construct($request_param)
    {
        parent::__construct($request_param);
    }

    public function query()
    {
        $this->rules = [
            ['pagesize', ['not_empty', 'digit', $this->rule_min(1)]],
            ['page', ['not_empty', 'digit', $this->rule_min(1)]],
            ['flag', ['not_empty']],
            ['attr_id', ['digit', $this->rule_min(1)]],
        ];

        return $this;
    }

    public function info()
    {
        $this->rules = [
            ['id', ['not_empty', 'digit', $this->rule_min(1)]],
        ];

        return $this;
    }

    public function exchange()
    {
        $this->rules = [
            ['id', ['not_empty', 'digit', $this->rule_min(1)]],
            ['book_num', ['not_empty', 'digit', $this->rule_min(1)]],
            ['receive_address_id', ['digit', $this->rule_min(1)]],
            ['linkman', ['not_empty']],
            ['linktel', ['not_empty', 'phone']],
            ['linkemail', ['email']],
        ];

        $this->validation->rule('mid', ['Rule_Member', 'need_member']);

        return $this;
    }

    public function get_order_list()
    {
        $this->rules = [
            ['pagesize', ['not_empty', 'digit', $this->rule_min(1)]],
            ['page', ['not_empty', 'digit', $this->rule_min(1)]],
        ];

        $this->validation->rule('mid', ['Rule_Member', 'need_member']);

        return $this;
    }

    public function get_default_address()
    {
        $this->validation->rule('mid', ['Rule_Member', 'need_member']);

        return $this;
    }

    public function get_order_info()
    {
        $this->rules = [
            ['id', ['not_empty', 'digit', $this->rule_min(1)]]
        ];

        $this->validation->rule('mid', ['Rule_Member', 'need_member']);

        return $this;
    }


}